package com.robot.agent.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.robot.agent.pojo.Agent;

/**
 * agent数据访问接口
 *
 * @author wuyunbin
 */
public interface AgentDao extends JpaRepository<Agent, String>, JpaSpecificationExecutor<Agent> {
    /**
     * 通过手机号查找
     *
     * @param phone
     * @return
     */
    Agent findAgentByPhone(String phone);

    /**
     * 通过areaId和status查询agent
     *
     * @param areaId
     * @param status
     * @return
     */
    public Agent findByAreaIdAndStatusAndDeletedAtIsNull(String areaId, String status);
}
